USE [Forums]
GO
/****** Object:  StoredProcedure [dbo].[SPQuestionUserRelInsert]    Script Date: 08/09/2012 11:30:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

Create PROCEDURE [dbo].[SPQuestionUserRelInsert]
	@questionID int
	,@userID int
AS
BEGIN TRY
	BEGIN TRANSACTION

	INSERT INTO ASKUserQuestionRel
	(
	userID, questionID
	)
	VALUES
	(
	@userID,@questionID
	)
	COMMIT

END TRY
BEGIN CATCH
	IF @@TRANCOUNT > 0
		ROLLBACK

  -- Raise an error with the details of the exception
	DECLARE @ErrMsg nvarchar(4000), @ErrSeverity int
	SELECT @ErrMsg = ERROR_MESSAGE(),
		 @ErrSeverity = ERROR_SEVERITY()

	RAISERROR(@ErrMsg, @ErrSeverity, 1)

END CATCH
